package com.cos.shop.util;

/**
 * @author: COS
 * @time: 2022/2/16 16:04
 * @description:
 */
public class StringUtils {

    public static boolean isNotEmpty(String... strs){
        for (String str : strs) {
            if (str==null||str.trim().length()==0) {
                return false;
            }
        }
        return true;
    }

    public static int toInt(String num){
        try {
            if (StringUtils.isNotEmpty(num)) {
                return Integer.valueOf(num);
            }
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
        return -1;
    }
    public static double toDouble(String num){
        try {
            if (StringUtils.isNotEmpty(num)) {
                return Double.valueOf(num);
            }
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
        return -1;
    }

}
